package com.thingsgrid.basicInterface.feign;


import com.thingsgrid.basicInterface.vo.BasicInterfaceVo;
import com.thingsgrid.basicInterface.vo.TypeTree;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;

@FeignClient(
	value = "thingsgrid-basicInterface"
)
public interface BasicInterfaceClient {


	String API_PREFIX = "/client";
	String APPAPI = API_PREFIX + "/AppApi";
	String TYPEINTERFACE = API_PREFIX + "/tyeInterface";
	String GETAPIBYGROP = API_PREFIX + "/getApiByGroup";
	String GETAPIBYPACKAGE = API_PREFIX + "/getApiByPackage";

	/***
	 * APP已申请的接口
	 * @param apiIds
	 * @return
	 */
	@GetMapping(APPAPI)
	List<BasicInterfaceVo> getApplicationApi(@RequestParam(value = "apiIds")  Collection<Long> apiIds );




	@GetMapping(TYPEINTERFACE)
	List<BasicInterfaceVo> getTypeInterface(@RequestParam(value = "id") Long id);


	@GetMapping(GETAPIBYGROP)
	String getAPITree(@RequestParam(value = "apiIds") Collection<Long> apiIds);


	@GetMapping(GETAPIBYPACKAGE)
	String getAPITreeByPackage(@RequestParam(value = "apiIds") Collection<Long> apiIds);
}
